#include<stdio.h>
void FindMaxMin(int num[], int n, int* pMax, int* pMaxPos, int* pMin, int *pMinPos)
{
    int i;
    *pMax = *pMin = num[0];
    *pMinPos = *pMaxPos = -1;
    for (i = 1; i < n; i++) {
        if (num[i] < *pMin)
        {
            *pMin = num[i];
                * pMinPos = i;
        }
        if (num[i] > *pMax)
        {
            *pMax = num[i];
            *pMaxPos = i;
        }
    }
}
int main()
{
	int i;
	int pMax,  pMaxPos,  pMin,  pMinPos;
	int num[10];
	for (i = 0; i < 10; i++)
		scanf("%d", &num[i]);
	FindMaxMin(num, 10, &pMax, &pMaxPos, &pMin, &pMinPos);
	printf("Max = %d , Position = %d, Min = %d, Position = %d\n", pMax, pMaxPos, pMin, pMinPos);
}